package cn.iocoder.yudao.module.pay.job.order;

import cn.iocoder.yudao.framework.pay.core.client.impl.hftx.vo.BaseCommonDemo;
import cn.iocoder.yudao.framework.pay.core.client.impl.hftx.vo.Identify;
import cn.iocoder.yudao.framework.pay.core.client.impl.hftx.vo.OppsMerchantConfigDemo;
import com.alibaba.fastjson.JSONObject;
import com.huifu.bspay.sdk.opps.core.request.V2TradePaymentScanpayQueryRequest;

import java.util.HashMap;
import java.util.Map;

/**
 * 交易查询接口 - 示例
 *
 * @author sdk-generator
 * @Description
 */
@Identify(requestClass = V2TradePaymentScanpayQueryRequest.class)
public class PaymentScanpayQueryRequestDemo extends BaseCommonDemo {

    public static void main(String[] args) throws Exception {

        // 1. 数据初始化
        doInit(OppsMerchantConfigDemo.getMerchantConfig());

        // 2.组装请求参数
        V2TradePaymentScanpayQueryRequest request = new V2TradePaymentScanpayQueryRequest();
        // 汇付商户号
        request.setHuifuId("6666000162463329");
        // 原机构请求日期
        request.setOrgReqDate("20250312");
        // 汇付服务订单号out_ord_id,org_hf_seq_id,org_req_seq_id 必填其一；汇付生成的服务订单号；&lt;br/&gt;&lt;font color&#x3D;&quot;green&quot;&gt;示例值：1234323JKHDFE1243252&lt;/font&gt;
       // request.setOutOrdId("20250319184326E71442");
        // 创建服务订单返回的汇付全局流水号out_ord_id,org_hf_seq_id,org_req_seq_id 必填其一；&lt;br/&gt;&lt;font color&#x3D;&quot;green&quot;&gt;示例值：00290TOP1GR210919004230P853ac13262200000&lt;/font&gt;
        request.setOrgHfSeqId("003600TOP4A250319184326P532ac1362d000000");
        // 服务订单创建请求流水号out_ord_id,org_hf_seq_id,org_req_seq_id 必填其一；&lt;br/&gt;&lt;font color&#x3D;&quot;green&quot;&gt;示例值：202110210012100005&lt;/font&gt;
        request.setOutOrdId("20250319184322T67944");

        // 设置非必填字段
        Map<String, Object> extendInfoMap = getExtendInfos();
        request.setExtendInfo(extendInfoMap);

        // 3. 发起API调用
        Map<String, Object> response = doExecute(request);
        System.out.println("返回数据:" + JSONObject.toJSONString(response));
    }

    /**
     * 非必填字段
     *
     * @return
     */
    private static Map<String, Object> getExtendInfos() {
        // 设置非必填字段
        Map<String, Object> extendInfoMap = new HashMap<>();
        return extendInfoMap;
    }

}
